
//
//  PopQQMessageView.m
//  XKStudyDemo
//
//  Created by xukai on 2017/11/30.
//  Copyright © 2017年 xukai. All rights reserved.
//

#import "PopQQMessageView.h"

@implementation PopQQMessageView

+(void) showMessageWith:(NSString *) message
{
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    UIView *showView = [[UIView alloc] initWithFrame:CGRectMake(0, -64, SCREEN_WIDHT, 64)];
    showView.backgroundColor = [UIColor whiteColor];
    [window addSubview:showView];
    UILabel *titleLab = [UILabel makeCommonWithFrame:CGRectMake(20, 5, SCREEN_WIDHT - 40, 64 - 10) textColor:ColorFromRGB(0x151515) bgColor:nil font:14 textAlignment:NSTextAlignmentCenter title:message];
    [showView addSubview:titleLab];
    
    [UIView animateWithDuration:0.5 animations:^{
        showView.top = 0;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.5 delay:1.5 options:0 animations:^{
            showView.bottom = 0;
        } completion:^(BOOL finished) {
            [showView removeFromSuperview];
        }];
    }];
    
}

@end
